<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{obj}}{{ary}}</h1>
        <button @click='fn'>按钮</button>
        <span v-if='false'>{{t}}</span>
    </div>
</body>
</html>
<script src="../node_modules/vue/dist/vue.js"></script>
<script>
  // 数组 ：更改数组触发试图更新 只能用 
    let vm = new Vue({
        el:'#app',
        data:{
            name:"珠峰",
            obj:{a:123},
            t:123,
            ary:[1,2,3]
        },
        methods: {
          fn(){
            this.obj.b = 345;// 数据已改 只是试图没更新
            // this.obj = Object.assign({b:123},this.obj)
            // this.t = Math.random()
            // this.$set(this.obj,'b',345)
            // console.log(this.$set)
            // this.ary[1] = 1000;
            // this.ary.splice(1,1,1000)
            this.ary = [1,2,3,4,5,6]
          }
        },

    });
</script>